var birdX = 200 //小鸟水平初始位置
var birdY = 250 //小鸟垂直初始位置
var gravity = 0.2; //重力
var speed = 0; //速度
var upspeed
var drop

function Bird() {
	birdDiv.style.marginLeft = birdX + 'px'
	birdDiv.style.marginTop = birdY + 'px'
	drop = setInterval(function() { //控制小鸟落下
		speed += gravity
		birdY += speed
		if (birdY > 470) {
			birdY = 470
			birdDiv.style.marginTop = '470px'
			gameEnd()
		} else if (birdY < 0) {
			birdDiv.style.marginTop = '0px'
			clearInterval(drop)
			clearInterval(showColumn)
			clearInterval(create)
			gameEnd()
		} else {
			birdDiv.style.marginTop = birdY + 'px'
		}
	}, 20)
	bg.onclick = function() {
		clearInterval(up)
		speed = 0; //速度
		upspeed = 8//初始上升速度
		var flag = 0
		var up = setInterval(function(){
			upspeed -= 0.3
			birdY -= upspeed
			flag++
			if(flag>=15){
				clearInterval(up)
			}
		},10)
	}
}
Bird()
